package context

import "github.com/gookit/validate"

type SMSPhoneContext struct {
	Telephone string `validate:"required|cnMobile" json:"telephone"` // 手机号码
}

// Messages 您可以自定义验证器错误消息
func (f SMSPhoneContext) Messages() map[string]string {
	return validate.MS{
		"required":           "{field}不能为空",
		"Telephone.cnMobile": "{field}输入不合法",
	}
}

// Translates 你可以自定义字段翻译
func (f SMSPhoneContext) Translates() map[string]string {
	return validate.MS{
		"Telephone": "用户手机",
	}
}
